import * as types from '../mutation-types'
// import {getGraffitiList} from '@/service/weixin'

const state = {
  name: 'weixin'
}

const getters = {
  revertName: (state) => {
    return state.name === 'weixin' ? 'wx' : 'weixin'
  }
}

const actions = {
  async [types.GET_GRAFFITI_LIST] ({ commit }, params) {
    // const result = await getGraffitiList(params)
    const result = {
      name: 'haha'
    }
    commit(types.SET_WX_NAME, {result})
  }
}

const mutations = {
  [types.SET_WX_NAME] (state, params) {
    state.name = params.name
  }
}

export default {
  state,
  getters,
  mutations,
  actions
}
